<?php

// uncomment the following to define a path alias
Yii::setPathOfAlias('rootPath','/opt/lampp/htdocs/giacatluong');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return CMap::mergeArray(
		require_once dirname(dirname(__FILE__)).'/modules/srbac/config.php', 
 	array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'i-yii CMS',
	//default controller or module to start
	'defaultController'=>'admin_dashboard',
	// preloading 'log' component
	'preload'=>array('log'),
	'theme'		=>	'admin',
	// autoloading model and component classes
	'import'=>array(
		'application.models.admin.*',
		'application.components.*',
		'ext.giix-components.*', // giix components
		'ext.widgets.*',
 		'ext.elrte.*',
 		'ext.highslide.*',
 		'application.helpers.*',
		//for user module
		'application.modules.user.models.*',
        'application.modules.user.components.*',
	),
	'behaviors' => array('ApplicationConfigBehavior'),
	'modules'=>array(
		// uncomment the following to enable the Gii tool
			'gii' => array(
				'class' => 'system.gii.GiiModule',
				'generatorPaths' => array(
					'ext.giix-core', // giix generators
				),
				'password'=>'123',
				'ipFilters'=>array('127.0.0.1','::1'),
			),
			'shop' => array( 'debug' => 'true'),
			'admin_ads',
			'admin_backend',
			'admin_news',
			'admin_media',
			'admin_widgets',
			'admin_comments',
			'user'=>array(
					'tableUsers' => 'tbl_users',
					'tableProfiles' => 'tbl_profiles',
					'tableProfileFields' => 'tbl_profiles_fields',
					'layout'	=>  'application.modules.admin_backend.views.layouts.sidebar_left',
			 ),
			 'admin_dashboard' => array(
			      'debug' => true,
			      'portlets' => array(
			        'PNews' => array('class' => 'PNews', 'visible' => true, 'weight' => 0), 
			        'Forums' => array('class' => 'Forums', 'visible' => true, 'weight' => 1), 
			        'Videos' => array('class' => 'Videos', 'visible' => true, 'weight' => 2), 
			        'Blogs' => array('class' => 'Blogs', 'visible' => true, 'weight' => 3), 
			        'Friends' => array('class' => 'Friends', 'visible' => true, 'weight' => 4),
			        'Apps' => array('class' => 'Apps', 'visible' => true, 'weight' => 5),
			      ),
			    ),
			 
	),

	// application components
	'components'=>array(
		'user'=>array(
                        // enable cookie-based authentication
                        'allowAutoLogin'=>true,
                        'loginUrl' => array('/user/login'),
                ),
		'db'=>array(
			'connectionString' => 'mysql:host=localhost;dbname=rs_giacatluong',
			'emulatePrepare' => true,
			'username' => 'root',
			'password' => '',
			'charset' => 'utf8',
		),
		
		'errorHandler'=>array(
			// use 'site/error' action to display errors
            'errorAction'=>'admin_backend/error',
        ),
		/*'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
				// uncomment the following to show log messages on web pages
				/*
				array(
					'class'=>'CWebLogRoute',
				),
				
			),
		),
		*/
	),

	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>array(
		// this is used in contact page
		'site_url'		=>	'http://localhost/giacatluong',
		'site_path'		=>	'/opt/lampp/htdocs/giacatluong',
		'adminEmail'=>	'webmaster@example.com',
		'languages'	=>	array(
									'vi'	=>	'Vietnamese',
									'en'	=>	'English',
									'pt'	=>	'Portuguese',
									'ru'	=>	'Russian',
									'fr'	=>	'France'
		),
		'widgets'	=>	array(
				array('class'=>'customHtml', 'title'=>'Custom Html'),
				array('class'=>'newsMiniBox', 'title'=>'News Box Mini'),
				array('class'=>'hello', 'title'=>'helllo'),
				array('class'=>'Wcomment', 'title'=>'Comment'),
		),
		'media_path'=>dirname(dirname(dirname(__FILE__))).DIRECTORY_SEPARATOR.'media',
		'photo'	=>	array('types'=>array('image/png','image/jpeg', 'image/gif'))
	),
));
